package com.han.bloghan.controller.api;

import com.han.bloghan.common.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping(value = "/v1/articles")
@Api(tags = "文章相关api")
public class ArticlesController {

    @GetMapping(value = "/list")
    @ApiOperation(value = "文章标题列表")
    public CommonResult list(){
        return CommonResult.success("ok");
    }

    @GetMapping(value = "/{list_id}/read")
    @ApiOperation(value = "根据标题id获得内容")
    public CommonResult read(@PathVariable(value = "list_id") Integer listId){
        return CommonResult.success("ok");
    }

    @PostMapping(value = "/")
    @ApiOperation(value = "存入新文档")
    public CommonResult write(){
        return CommonResult.success("ok");
    }

    @PutMapping(value = "/{list_id}")
    @ApiOperation(value = "修改文档")
    public CommonResult update(@PathVariable(value = "list_id") Integer listId){
        return CommonResult.success("ok");
    }

    @DeleteMapping(value = "/{list_id}")
    @ApiOperation(value = "删除文章")
    public CommonResult delete(@PathVariable(value = "list_id") Integer listId){
        return CommonResult.success("ok");
    }
}
